package com.ncr.travel.appmgr.service.mapper;

import org.codehaus.jackson.Version;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.module.SimpleModule;

import com.ncr.travel.appmgr.model.TextJson;

//@Component
public class AppManagerObjectMapper extends ObjectMapper {

	private TextDeserializer textDeserializer;
	private SimpleModule module;

	public AppManagerObjectMapper() {
		super();
		Version version = new Version(1, 0, 0, null);
		module = new SimpleModule("PolymorphicTextDeserializerModule", version);
	}

	public TextDeserializer getTextDeserializer() {
		return textDeserializer;
	}

	public void setTextDeserializer(TextDeserializer textDeserializer) {
		this.textDeserializer = textDeserializer;
		module.addDeserializer(TextJson.class, textDeserializer);
		registerModule(module);
	}

	public SimpleModule getModule() {
		return module;
	}

	public void setModule(SimpleModule module) {
		this.module = module;
	}

}
